#ifndef HPLC_QINFINE_FINDPACKET_H
#define HPLC_QINFINE_FINDPACKET_H

#include "basefindpacket.h"
#include "hplcqinfinedefine.h"

namespace hplc
{
namespace qinfine
{

class HplcQinfineFindPacket : public BaseFindPacket
{
    Q_OBJECT
public:
    HplcQinfineFindPacket(QObject *parent = nullptr);
    virtual ~HplcQinfineFindPacket() override;

    virtual QList<ProtocolPacket> find(const QByteArray &data) override;

signals:
    void errorPacket(quint8 errorCode);

private:
    quint32             m_framePos = 0;
    QByteArray          m_rxBufferAscii; // 这个缓冲区主要用于Ascii转Hex
//    QByteArray          m_rxBufferHex;

    /*
     * 主要用于统计错误包，如果接收到HEAD/ACK/NACK，则前面的字节看做一个错误包
     */
    bool m_isHadErrorBytes = false;;
};

} // qinfine
} // hplc


#endif // HPLC_QINFINE_FINDPACKET_H
